// import http from "../../utils/http";
import http from "@/utils/http";
export interface classifyitem{
    _id?:string;
        name?:string; 
        parentId?:number; 
        sort?: number;
        state?: number;
        icon?:string;
        image?:string;
        children?: classifyitem[]
}
export interface searchparams{
_id?:string;
name?:string;
state?:string;
}






const  classifies = {
    // 查询商品分类数据
    search: (data?: pagequery&searchparams) => http.post('/classifies/search', data),
    // 新增商品分类数据
    add: (data: classifyitem) => http.post('/classifies/add', data),
    // 删除商品分类数据
    remove: (data:deleteparams ) => http.delete('/classifies/remove', data),
    // 修改商品分类数据
    update: (data: classifyitem) => http.put('/classifies/update', data)
}


export default classifies